package com.sunjq.multithread.executorexample;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.sunjq.multithread.Fibonaci;

public class ThreadPoolExample {

	ExecutorService es = Executors.newCachedThreadPool();

	private void runThread() {
		for (int i = 0; i < 5; i++) {
			es.execute(new Fibonaci(5));
		}
		es.shutdown();
	}

	public static void main(String args[]) {
		ThreadPoolExample tpe = new ThreadPoolExample();
		tpe.runThread();
	}
}
